//--------------------------------------------------------------------------------
// This file is part of the Windows Workflow Foundation Sample Code
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This source code is intended only as a supplement to Microsoft
// Development Tools and/or on-line documentation.  See these other
// materials for detailed information regarding Microsoft code samples.
// 
// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//--------------------------------------------------------------------------------

using System;
using System.ComponentModel;
using System.Workflow.Activities;
using System.Drawing;

namespace Microsoft.Samples.Workflow.UI.Design
{
    class NavigatorWorkflowDesigner : NavigatorDesigner
    {
       static readonly Size MinSize = new Size(240, 240);

        public override Size MinimumSize
        {
            get
            {
                Size minimumSize = base.MinimumSize;

                minimumSize.Width = Math.Max(minimumSize.Width, MinSize.Width);
                minimumSize.Height = Math.Max(minimumSize.Height, MinSize.Height);

                return minimumSize;
            }
        }

        protected override bool IsSupportedActivityType(Type activityType)
        {
            if (Helpers.IsOOBStateMachineActivity(activityType) ||
                Helpers.IsOOBWebServiceActivity(activityType) ||
                typeof(NavigatorWorkflow).IsAssignableFrom(activityType))
            {
                return false;
            }

            return base.IsSupportedActivityType(activityType);
        }
    }
}

